home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 54
/
054.d81
/
star copier
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
9KB
|
272 lines
0 ifa=.thena=1:load"copier.o",8,1
4 goto100
10 sys sd,dn$,bf%,nf%,fi$(.),nb%(.),ft%(.),s%(.),tr%(.),se%(.),l$(.):return
28 :
30 poke214,4:print:printtab(11)"[154]"s$(cs)
32 print"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,2
34 poke214,6:print:fora=1to14
36 print" "
38 next
39 return
40 poke214,21:print
42 fora=1to2:print" ":next
44 print"[145][145]";:return
50 b=.:fora=8to11:open15,a,15:close15
52 d(a-7)=.:ifst=.thend(a-7)=a:b=b+1
54 next:fora=1to4:ifd(a)<>.thensd%=d(a):a=4
56 next:ifb=1thentd%=sd%:return
58 fora=sd%-6to4:ifd(a)<>.thentd%=d(a):a=4
60 next:return
65 hi=int(a/256):lo=a-hi*256:return
70 open15,sd%,15,"i0":input#15,er,er$,tr,se:close15:ok=-1:ifer=.thenreturn
71 poke214,15:print:fora=1to3:print" "
72 next:print"[145][145][145] --- drive error ---"
73 a$="error:"+str$(er)+" "+er$:printtab((20-len(a$)/2)+1)a$
74 print"[154] track:"tr;tab(23)"[154]sector:"se:ok=not(ok):return
75 gosub40:print" [154]press space [154]to return to"
76 print" the main menu":poke198,.
78 ifpeek(203)<>60then78
79 return
80 s$(1)=" view directory "
81 s$(2)=" copy files "
82 s$(3)=" scratch files "
83 s$(4)=" disk command "
84 s$(5)=" quit program "
89 :
90 m$(1)="1. view directory"
91 m$(2)="2. copy files "
92 m$(3)="3. scratch files "
93 m$(4)="4. disk command "
94 m$(5)="5. quit program "
99 return
100 poke55,.:poke56,64:clr:poke650,128
120 poke53280,2:poke53281,.:co=54272
130 op=16384:ni=op+29:en=op+176
135 sl=16754:up=17633:dn=up+3
136 re=17903:wr=18269:sd=18420
140 dim fi$(144),nb$(144),ft%(144),s%(144),l$(144),nf%,ns%,tr%(144),se%(144)
145 dim sa(145)
146 cs=1:ns=5:dim m$(ns),s$(ns),d(4)
150 t$(.)="del":t$(5)=" deleted "
151 t$(1)="seq":t$(6)="sequential"
152 t$(2)="prg":t$(7)=" program "
153 t$(3)="usr":t$(8)=" user "
154 t$(4)="rel":t$(9)=" relative "
159 sp$=" "
160 printchr$(142)"[147] [158]star copier"
170 print" by mike maynard"
180 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
190 gosub80:gosub50
200 ifflthenpoke214,21:print:goto217
210 gosub34:print" [154]main menu "
211 print"[158][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,7
212 fora=1tons+2
213 print"[150] ";:next
214 print"[146][158][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1623,99:poke1623+co,7
215 poke214,20:print
216 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1903,99:poke1903+co,2
217 print" [154]use the cursor keys [154]to move the"
218 print" reversed area. press return [154]to select.":ifflthen250
219 fora=217to242:pokea,peek(a)or128:next:poke214,7:print
220 fora=1tons
230 ifa=csthenprinttab(11)""m$(a):goto245
240 printtab(11)"[150]"m$(a)
245 next
250 poke214,15:print:print" [145]"
255 print" source device number:[153]"sd%:pokeop+3,sd%
256 print" "
260 poke214,17:print:print" [145]"
265 print" target device number:[153]"td%
266 print" ":ifflthen280
270 poke214,6+ls:print:printtab(11)"[150]"m$(ls)
275 poke214,6+cs:print:printtab(11)""m$(cs)
280 ls=cs:fl=.
290 a=peek(203):ifa<>13anda<>22anda<>1anda<>7anda<>2then290
295 ifa=1then on cs goto 1000,2000,3000,4000,5000
297 ifa=13ora=22then400
300 if(peek(653)and1)then360
310 ifa=7thencs=cs+1:ifcs>nsthencs=1
320 ifa=2thencs=cs-1:ifcs=.thencs=ns
350 goto270
360 ifa=7thencs=cs-1:ifcs=.thencs=ns
370 ifa=2thencs=cs+1:ifcs>nsthencs=1
380 goto270
400 ifa=13thensd%=sd%+1:ifsd%=12thensd%=8
410 ifa=22thentd%=td%+1:iftd%=12thentd%=8
415 ifd(sd%-7)=.ord(td%-7)=.then400
420 poke214,15:print:printtab(29)"[153]"sd%"[157] ":pokeop+3,sd%
430 poke214,17:print:printtab(29)"[153]"td%"[157] "
440 goto290
1000 gosub70:ifnot(ok)thenfl=1:goto1130
1002 poke1020,8:poke1021,1:poke1022,40:poke1023,14
1003 gosub30:gosub40:print" [154]press: p[154] to pause"
1004 print" a[154] to abort"
1010 poke214,6:print:sys(op)
1020 sys(ni),dn$,bf%:bf$=str$(bf%):bf$=right$("00"+right$(bf$,len(bf$)-1),3)
1030 id$=right$(dn$,2):dn$=left$(dn$,16):poke1020,9:poke1023,13
1035 poke214,4:print:print"[154] disk name:"dn$tab(33)"[154]id:"id$"[153]":bu%=.:nf%=.
1040 print" [158]blks[221] [158]type [221] [158]filename [221][158]trk [221][158]sec":ln%=1:poke198,.
1050 sys(en),fi$,nb%,ft%
1052 s=.:ifft%<5thens=1
1054 ft%=ft%and127
1060 nb$=" "+str$(nb%):nb$=right$(nb$,3):ifft%<1then1084
1070 bu%=bu%+nb%:nf%=nf%+1:ln%=ln%+1:ifln%>14thenln%=14:sysup:print"[145][145]"
1075 tr$=right$(" "+str$(peek(re+3)),2):se$=right$(" "+str$(peek(re+4)),2)
1080 print" [153]"nb$" [221] ";:if(ft%and64)thenft%=ft%and63:print"[157][156]>";
1081 print" ";:if(s)thenprint"[157]*";
1082 print"[153]"t$(ft%and15)" [221][153]";:poke212,1:printleft$(fi$+sp$,16);
1083 poke212,.:print" [221][153] "tr$" [221][153] "se$
1084 geta$:ifa$<>"a"anda$<>"p"then1100
1085 ifa$="a"then1096
1086 cl=peek(214):gosub40:print" [158]view directory paused"
1088 print" [154]press space [154]to continue":poke198,.
1090 ifpeek(203)<>60then1090
1092 gosub40:print" [154]press: p[154] to pause"
1094 print" a[154] to abort[153]":poke214,cl-1:print:goto1100
1096 ifln%<13then1098
1097 forb=1to((ln%=13)*-1+(ln%=14)*-2):sysup:print"[145][145]":next
1098 print" [150]view directory aborted!":ln%=ln%+2:ifln%>14thenln%=14
1099 close3:close15:bu$="???":ot$=bu$:nf$=bu$:goto1110
1100 ifpeek(2)=.then1050
1105 bu$=str$(bu%):bu$=right$("00"+right$(bu$,len(bu$)-1),3)
1106 ot$=str$(664-bf%-bu%):ot$=right$("00"+right$(ot$,len(ot$)-1),3)
1107 nf$=str$(nf%):nf$=right$("00"+right$(nf$,len(nf$)-1),3)
1110 ifln%<13then1120
1112 forb=1to((ln%=13)*-2+(ln%=14)*-3):sysup:print"[145][145]":next
1120 print" [158]blocks->[154]free:"bf$" [154]used:"bu$" [154]other:"ot$
1125 print"[154] total number of files:"nf$
1130 poke1020,8:poke1023,14:gosub75:goto200
2000 gosub9000:ifnot(ok)then1130
2010 gosub6500
2020 gosub30:poke214,6:print
2030 fora=1to14:printtab(19)"[221]":next
2035 poke214,6:print:printtab(5)"[158]reading:"tab(26)"writing:":c1%=.:c2%=.
2040 cf%=1:f%=.:ln%=.:ap%=.:fu%=.
2050 bf%=1:sa(1)=24458:poke214,c1%+7:print
2060 poke1020,9:poke1021,1:poke1022,18:poke1023,13
2100 ifs%(cf%)=.then2160
2102 ifft%(cf%)>4then2110
2104 ifc1%>11thenforb=1to((c1%=12)*-1+(c1%=13)*-2):sysup:print"[145][145]":next
2106 c1%=c1%+1:s%(cf%)=.:a$=fi$(cf%):print
2107 print"[145]"tab(10-len(a$)/2)"[150]"a$:printtab(2)"can't copy splat"
2108 ns%=ns%-1:ifns%=.then2290
2109 goto2160
2110 c1%=c1%+1:if(c1%>13)and(fu%=.)thenc1%=13:sysup:print"[145][145]"
2113 if(fu%)thenprint"[145][145]"
2115 a$=fi$(cf%):printtab(10-len(a$)/2)""a$
2120 a=sa(bf%):gosub65:poke251,lo:poke252,hi
2125 if(fu%)thenfu%=.:tr%(cf%)=tk%:se%(cf%)=sc%
2130 sys(re),sd%,tr%(cf%),se%(cf%)
2135 print"[145]"tab(10-len(a$)/2)""a$
2140 if(peek(2)and3)then6000
2142 if(peek(2)and32)thenfu%=1:tk%=peek(re+3):sc%=peek(re+4):goto2150
2144 if(peek(2)and128)then6100
2150 bf%=bf%+1:sa(bf%)=peek(251)+peek(252)*256:if(fu%)then2170
2160 cf%=cf%+1:ifcf%<=nf%then2100
2170 ifsd%<>td%then2200
2180 gosu